//
//  ChangePasswordView.m
//  NtoccShipper
//
//  Created by 张天兴 on 2025/6/27.
//  Copyright © 2025 zhuchongjin. All rights reserved.
//

#import "ChangePasswordView.h"

@implementation ChangePasswordView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        [self setUI];
    }
    return self;
    
}

- (void)setUI{
    [self addSubview:self.bgView];
}
-(UIView *)bgView{
    if (_bgView == nil) {
        self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)];
        self.bgView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.6];
        [self.bgView addSubview:self.tanView];
    }
    return _bgView;
}

-(UIView *)tanView{
    if (_tanView == nil) {
        self.tanView = [[UIView alloc] initWithFrame:CGRectMake(15, (SCREEN_HEIGHT - 175)/2, SCREEN_WIDTH - 30, 175)];
        self.tanView.backgroundColor = [UIColor whiteColor];
        self.tanView.layer.masksToBounds = YES;
        self.tanView.layer.cornerRadius = 10;
        [self.tanView addSubview:self.topButton];
        [self.tanView addSubview:self.contentLabel];
        [self.tanView addSubview:self.gotoInfoButton];
    }
    return _tanView;
}

- (UIButton *)topButton{
    if (_topButton == nil) {
        self.topButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [self.topButton setFrame:CGRectMake(10, 10, SCREEN_WIDTH - 50, 44)];
        [self.topButton setBackgroundColor:[UIColor colorWithRed:248/255.0 green:251/255.0 blue:255/255.0 alpha:1]];
        self.topButton.layer.masksToBounds = YES;
        self.topButton.layer.cornerRadius = 10;
        self.topButton.enabled = NO;
        [self.topButton setImage:[UIImage imageNamed:@"wanshangInfor"] forState:(UIControlStateNormal)];
        [self.topButton setTitle:@"请完善安全信息" forState:(UIControlStateNormal)];
        [self.topButton setTitleColor:[UIColor colorWithRed:50/255.0 green:50/255.0 blue:50/255.0 alpha:1] forState:(UIControlStateNormal)];
        self.topButton.titleLabel.font = [UIFont systemFontOfSize:15];
        self.topButton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 20);
    }
    return _topButton;
}

- (UILabel *)contentLabel{
    if (_contentLabel == nil) {
        self.contentLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, CGRectGetMaxY(self.topButton.frame) + 5, SCREEN_WIDTH - 70, 40)];
        self.contentLabel.text = @"请用户完善安全信息后使用平台功能，安全信息完善前无法使用平台";
        self.contentLabel.textColor = [UIColor colorWithRed:237/255.0 green:107/255.0 blue:134/255.0 alpha:1];
        self.contentLabel.font = [UIFont systemFontOfSize:15];
        self.contentLabel.numberOfLines = 0;
    }
    return _contentLabel;
}

- (UIButton *)gotoInfoButton{
    if (_gotoInfoButton == nil) {
        self.gotoInfoButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [self.gotoInfoButton setFrame:CGRectMake(10, CGRectGetMaxY(self.contentLabel.frame) + 10, SCREEN_WIDTH - 50, 44)];
        [self.gotoInfoButton setBackgroundColor:[UIColor colorWithRed:28/255.0 green:179/255.0 blue:158/255.0 alpha:1]];
        self.gotoInfoButton.layer.masksToBounds = YES;
        self.gotoInfoButton.layer.cornerRadius = 10;
        self.gotoInfoButton.titleLabel.font = [UIFont systemFontOfSize:15];
        [self.gotoInfoButton setTitle:@"前往完善信息" forState:(UIControlStateNormal)];
    }
    return _gotoInfoButton;
}

@end
